import request from "@/utils/request";

// 获取用户列表（店铺人员管理）
export function listTwo(query) {
  return request({
    url: "/system/user/listTwo",
    method: "get",
    params: query,
  });
}

// 新增用户（店铺人员管理）
export function addSysUserTwo(data) {
  return request({
    url: "/system/user/addSysUserTwo",
    method: "post",
    data: data,
  });
}

// 修改用户
export function userDemo(data) {
  return request({
    url: "/system/user",
    method: "put",
    data: data,
  });
}

// 删除用户
export function delUser(userId) {
  return request({
    url: "/system/user/" + userId,
    method: "delete",
  });
}

// 重置密码
export function resetPwd(data) {
  return request({
    url: "/system/user/resetPwd",
    method: "put",
    data: data,
  });
}

// 用户状态修改
export function changeUserStatus(userId, status) {
  const data = {
    userId,
    status,
  };
  return request({
    url: "/system/user/changeStatus",
    method: "put",
    data: data,
  });
}
